/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package project.jpdftools.other;

/**
 *
 * @author Ahmed
 */
public class KeyValue {

    private String value;
    private String key;

    public KeyValue(String key, String value) {
        this.key = key;
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public String getKey() {
        return key;
    }

    public String getKeyAsString() {
        return String.valueOf(key);
    }

    @Override
    public String toString() {
        return value;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof KeyValue) {
            KeyValue kv = (KeyValue) obj;
            return (kv.value.equals(this.value));
        }
        return false;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.value != null ? this.value.hashCode() : 0);
        return hash;
    }
}
